{
int iter;
#ifdef G_ENABLE_DEBUG
- if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
+ if (GDK_DEBUG_CHECK (FRAMES))
{
if (priv->phase != GDK_FRAME_CLOCK_PHASE_LAYOUT &&
(priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT))
if (priv->freeze_count == 0)
{
#ifdef G_ENABLE_DEBUG
- if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
+ if (GDK_DEBUG_CHECK (FRAMES))
{
if (priv->phase != GDK_FRAME_CLOCK_PHASE_PAINT &&
(priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT))
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
#ifdef G_ENABLE_DEBUG
- if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
+ if (GDK_DEBUG_CHECK (FRAMES))
timings->frame_end_time = g_get_monotonic_time ();
#endif /* G_ENABLE_DEBUG */
}
}
#ifdef G_ENABLE_DEBUG
- if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
+ if (GDK_DEBUG_CHECK (FRAMES))
{
if (timings && timings->complete)
_gdk_frame_clock_debug_print_timings (clock, timings);
#ifdef G_ENABLE_DEBUG
-#define GDK_NOTE(type,action) G_STMT_START { \
- if (_gdk_debug_flags & GDK_DEBUG_##type) \
+#define GDK_DEBUG_CHECK(type) G_UNLIKELY (_gdk_debug_flags & GDK_DEBUG_##type)
+
+#define GDK_NOTE(type,action) G_STMT_START { \
+ if (GDK_DEBUG_CHECK (type)) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
+#define GDK_DEBUG_CHECK(type) 0
#define GDK_NOTE(type,action)
#endif /* G_ENABLE_DEBUG */
xconfine_to = GDK_WINDOW_XID (confine_to);
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_NOGRABS)
+ if (GDK_DEBUG_CHECK (NOGRABS))
status = GrabSuccess;
else
#endif
&mask.mask_len);
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_NOGRABS)
+ if (GDK_DEBUG_CHECK (NOGRABS))
status = GrabSuccess;
else
#endif
_gdk_x11_event_translate_keyboard_string (&event->key);
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_EVENTS)
+ if (GDK_DEBUG_CHECK (EVENTS))
{
g_message ("%s:\t\twindow: %ld key: %12s %d",
event->type == GDK_KEY_PRESS ? "key press " : "key release",
case VisibilityNotify:
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_EVENTS)
+ if (GDK_DEBUG_CHECK (EVENTS))
switch (xevent->xvisibility.state)
{
case VisibilityFullyObscured:
timings->complete = TRUE;
#ifdef G_ENABLE_DEBUG
- if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
+ if (GDK_DEBUG_CHECK (FRAMES))
_gdk_frame_clock_debug_print_timings (clock, timings);
#endif /* G_ENABLE_DEBUG */
}
context_x11->xdnd_have_actions = TRUE;
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_DND)
+ if (GDK_DEBUG_CHECK (DND))
{
GString *action_str = g_string_new (NULL);
if (context->actions & GDK_ACTION_MOVE)
}
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_DND)
+ if (GDK_DEBUG_CHECK (DND))
print_target_list (context->targets);
#endif /* G_ENABLE_DEBUG */
Window win;
gint w, h;
- if (!(_gdk_debug_flags & GDK_DEBUG_XINERAMA))
+ if (!GDK_DEBUG_CHECK (XINERAMA))
return FALSE;
/* Fake Xinerama mode by splitting the screen into 4 monitors.
}
#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_MISC)
+ if (GDK_DEBUG_CHECK (MISC))
{
static const gchar *const visual_names[] =
{
if (impl->toplevel->current_counter_value % 2 == 1)
{
#ifdef G_ENABLE_DEBUG
- if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
+ if (GDK_DEBUG_CHECK (FRAMES))
{
XImage *image = XGetImage (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),